package org.gthelper.testtools;

import java.io.IOException;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;



public class Printer
{
	public static void printnote(String note)
	{
		System.out.println("\n"+note+"-------------------------------------------JustForNote");
	}
	
	public static void print(String note,byte[] msg)
	{
		printnote(note);
		try {
			System.out.write(msg);
			System.out.print("\n");
		} catch (IOException e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}
	}
	
	
	public static void print(String note,long l)
	{
		printnote(note);
		System.out.println(l);
	}
	
	
	public static void print(String note,String msg)
	{
		printnote(note);
		System.out.print(msg+"\n");
	}
	
	/** 
	 * BASE64解密 
	 *  
	 * @param key 
	 * @return 
	 * @throws Exception 
	 */  
	public static byte[] decryptBASE64(String key) throws Exception {  
	    return (new BASE64Decoder()).decodeBuffer(key);  
	}  
	  
	/** 
	 * BASE64加密 
	 *  
	 * @param key 
	 * @return 
	 * @throws Exception 
	 */  
	public static String encryptBASE64(byte[] key) throws Exception {  
	    return (new BASE64Encoder()).encodeBuffer(key);  
	} 
}